// ==========================================================================
// GFast自动生成controller操作代码。
// 生成日期：2024-04-26 15:54:41
// 生成路径: internal/app/business/controller/ticket_remain.go
// 生成人：周志雄
// desc:节目票剩余
// company:云南奇讯科技有限公司
// ==========================================================================


package controller


import (
    "context"
    "github.com/tiger1103/gfast/v3/api/v1/business"
    "github.com/tiger1103/gfast/v3/internal/app/business/service"    
    systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"    
)


type ticketRemainController struct {    
    systemController.BaseController    
}


var TicketRemain = new(ticketRemainController)


// List 列表
func (c *ticketRemainController) List(ctx context.Context, req *business.TicketRemainSearchReq) (res *business.TicketRemainSearchRes, err error) {
	res, err = service.TicketRemain().List(ctx, req)
	return
}


// Get 获取节目票剩余
func (c *ticketRemainController) Get(ctx context.Context, req *business.TicketRemainGetReq) (res *business.TicketRemainGetRes, err error) {
    res = new(business.TicketRemainGetRes)
	res.TicketRemainInfoRes,err = service.TicketRemain().GetById(ctx, req.Id)
	return
}


// Add 添加节目票剩余
func (c *ticketRemainController) Add(ctx context.Context, req *business.TicketRemainAddReq) (res *business.TicketRemainAddRes, err error) {
	err = service.TicketRemain().Add(ctx, req)
	return
}


// Edit 修改节目票剩余
func (c *ticketRemainController) Edit(ctx context.Context, req *business.TicketRemainEditReq) (res *business.TicketRemainEditRes, err error) {
	err = service.TicketRemain().Edit(ctx, req)
	return
}


// Delete 删除节目票剩余
func (c *ticketRemainController) Delete(ctx context.Context, req *business.TicketRemainDeleteReq) (res *business.TicketRemainDeleteRes, err error) {
	err = service.TicketRemain().Delete(ctx, req.Ids)
	return
}